var express = require('express');
var router = express.Router();
//操作文件
const { uploadFiles, moveFiles, removeFiles } = require("./../utils/handleFiles");

const { getOrders, delOrders, findOrders } = require("./../service/ordersService");
//获取订单
router.get('/getOrders', async function (req, res, next) {
    const { data, total } = await getOrders(req.query);
    res.send({
        message: '获取成功',
        state: 1,
        data,
        total
    });
})
//删除
router.post('/delOrders', async function (req, res, next) {
    const data = await delOrders(req.body);
    res.send(data);
})
//查找
router.post('/findOrders', async function (req, res, next) {
    const data = await findOrders(req.body);
    res.send(data);
})
module.exports = router;